import java.time.Year;

public class Thoroughbred {
    // 属性：母亲、父亲、出生年份，均为私有可见性
    private Thoroughbred mother;
    private Thoroughbred father;
    private int birthyear;

    // 构造方法，初始化属性
    public Thoroughbred(Thoroughbred mother, Thoroughbred father, int birthyear) {
        this.mother = mother;
        this.father = father;
        this.birthyear = birthyear;
    }

    // 获取当前年龄，通过当前年份减去出生年份计算
    public int getCurrentAge() {
        int currentYear = Year.now().getValue();
        return currentYear - birthyear;
    }

    // 获取父亲对象
    public Thoroughbred getFather() {
        return father;
    }

    // 获取母亲对象
    public Thoroughbred getMother() {
        return mother;
    }
}